<?php
#this is the dictionnary
// Désactiver le rapport d'erreurs todo on production site
#error_reporting(0);
#todo: faire le fichier, faire updateDictionnary.php, le copier sur newDictionnary.php et copier updateDictionnary.php sur insertDictonnary.php

$titre_page="Dictionnaire: éditer un enregistrement";
include("header.inc.php");
$id=$_GET['id'];
include("clavier.inc.php"); //insertion du clavier russe

$sql = "SELECT * FROM `" .$latable ."` WHERE `id` = '" .$id ."'"; 
#echo $sql;
$sqlQ=mysql_query($sql);
if(!$sqlQ) {
echo "Error SQL : " .$sql ."<br>" .mysql_error();
}
echo "<h1>" .$titre_page ."</h1>";
echo "<form action=\"updateDictionnary.php\" method=\"GET\">";
/*
id 	
foreign 	
local 	
type 	
date 
*/

$id=mysql_result($sqlQ,0,'id');
$foreign=mysql_result($sqlQ,0,'foreign');
$local=mysql_result($sqlQ,0,'local');
$type=mysql_result($sqlQ,0,'type');
$date=mysql_result($sqlQ,0,'date');

echo "<table>";
echo "<input type=\"hidden\" name=\"id\" value=\"" .$id ."\">";
echo "<tr><td>russe</td><td><textarea name=\"foreign\" id=\"traduction\">" .$foreign ."</textarea></td></tr>\n";
echo "<tr><td>français</td><td><textarea name=\"local\">" .$local ."</textarea></td></tr>\n";
echo "<tr><td>type</td><td><input type=\"text\" name=\"type\" value=\"" .$type ."\"></td></tr>\n";
echo "<tr><td>date</td><td><input type=\"text\" name=\"date\" value=\"" .$date ."\"></td></tr>\n";
echo "<tr><td colspan=\"2\" class=\"cellule_action\"><input type=\"submit\"></td></tr>";
echo "</table>";
echo "</form>";
include("footer.inc.php");
?>


